/**
 * jims
 */
package com.jims.master.modules.sys.service;

import com.jims.master.common.persistence.Page;
import com.jims.master.common.service.CrudService;
import com.jims.master.modules.sys.dao.UserAddressDao;
import com.jims.master.modules.sys.entity.UserAddress;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 地址表Service
 * @author jct
 * @version 2017-12-05
 */
@Service
@Transactional(readOnly = true)
public class UserAddressService extends CrudService<UserAddressDao, UserAddress> {

    /**
     * @Title:
     * @Description: （根据用户id查找地址）
     * @param userId  用户id
     * @return
     * @author jict
     * @date 2017/12/5
     * @throws
     */
    public List<UserAddress> getUserAddress(String userId){
        return this.dao.getUserAddress(userId);
    }

    /**
     * @Title:
     * @Description: （根据用户id查找默认地址）
     * @param userId  用户id
     * @return
     * @author jict
     * @date 2017/12/5
     * @throws
     */
    public UserAddress getDefaultAddress(String userId){
        return this.dao.getDefaultAddress(userId);
    }
}